{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- 上述meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <!-- Bootstrap CSS -->
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="{% static 'login/css/login.css' %}" rel="stylesheet"/>
    <title>登录</title>
</head>
<body>

<div class="container">
    <div class="container">
        <div class="col">
            <form class="form-login" action="/login/" method="post">
                {% if message %}
                    <div class="alert alert-warning">{{ message }}</div>
                {% endif %}
                {% csrf_token %}
                <h3 class="text-center">欢迎登录</h3>

                <div class="form-group">
                    {{ login_form.username.label_tag }} {# <label for="id_username">用户名:</label> #}
                    {{ login_form.username}} {# <input type="text" name="username" maxlength="128" required id="id_username"> #}
                    {# <input type="text" name="username" class="form-control" placeholder="Username" autofocus="" maxlength="128" required id="id_username"> #}
                </div>
                <div class="form-group">
                    {{ login_form.password.label_tag }}
                    {{ login_form.password }}
                    {# <input type="password" name="password" class="form-control" placeholder="Password" maxlength="256" required id="id_password"> #}
                </div>
                <div class="form-group">
                    {{ login_form.captcha.label_tag }}
                    {{ login_form.captcha }}
                </div>
                <div>
                    <a href="/register/" class="text-success " ><ins>新用户注册</ins></a>
                    <button type="submit" class="btn btn-primary float-right">登录</button>
                </div>
            </form>
        </div>
    </div>
</div><!-- /container -->

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    {#    以下三者的引用顺序是固定的#}
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.15.0/umd/popper.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

</body>
</html>